﻿#pragma once

#include <iostream>
#include <fstream>
#include <QDebug>
#include "fastdeploy/vision.h"

#ifdef WIN32
const char sep = '\\';
#else
const char sep = '/';
#endif

using namespace std;
using namespace cv;

class IdCardOcr
{
public:
    string det_model_dir;
    string cls_model_dir;
    string rec_model_dir;
    string rec_label_file;
    fastdeploy::RuntimeOption option;
    fastdeploy::vision::ocr::DBDetector det_model;
    fastdeploy::vision::ocr::Recognizer rec_model;
    fastdeploy::vision::ocr::Classifier cls_model;
    fastdeploy::pipeline::PPOCRv3* model;
    void init();
    IdCardOcr() {}
    IdCardOcr(string det_model_dir, string cls_model_dir, string rec_model_dir, string rec_label_file, string device);
    IdCardOcr(string det_model_dir, string rec_model_dir, string rec_label_file, string device);
    string infer(Mat& image);
};

